import { useState } from 'react';
import { Card, Divider, Switch } from 'antd';
import { TextStyle } from './style';
import { GridSort } from '@/components/DraggableSort';

const TestComponent = () => {
	const [dragSort, setDragSort] = useState(false);
	const [data, setData] = useState([{ id: 1, name: 'aaa' }]);

	return (
		<Card>
			<Switch
				checkedChildren="开启"
				unCheckedChildren="关闭"
				checked={dragSort}
				onChange={setDragSort}
			/>
			<Divider />
			<GridSort
				dragSort={dragSort}
				data={data}
				setData={(data) => setData(data)}
				component={(data) => <TextStyle>{data.name}</TextStyle>}
			/>
		</Card>
	);
};

export default TestComponent;
